package com.niubi.yygh.hosp.controller;

import com.niubi.yygh.common.result.R;
import com.niubi.yygh.hosp.service.DepartmentService;
import com.niubi.yygh.model.hosp.Department;
import com.niubi.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "科室接口")
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
  @Autowired
  DepartmentService departmentService;

  @ApiOperation(value = "查询医院所有科室列表")
  @GetMapping("getDeptList/{hoscode}")
  public R getDeptList(@PathVariable String hoscode){
    List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
    return R.ok().data("list",list);
  }

}
